var momObj=function()
{
	this.x;
	this.y;
	this.angle;
	this.bigBody=new Image();
	this.bigTail=new Image();
	
	this.bigTailTimer=0;
	this.tailCount=0;
	
	this.bigEyeTimer=0;
	this.eyeCount=0;
	this.internal=1000;
	
	this.momBodyCount=0;
}

momObj.prototype.init=function()
{
	this.x=canWidth*0.5;
	this.y=canHeight*0.5;
	this.angle=0;
	this.bigBody.src="./src/bigSwim0.png";
	this.bigTail.src="./src/bigTail0.png";
}

momObj.prototype.draw=function()
{
	//lerp x,y
	this.x=lerpDistance(mx,this.x,0.95);
	this.y=lerpDistance(my,this.y,0.95);
	
	//delta angle
	//Math.atan2(y,x)
	var deltaY=my-this.y;
	var deltaX=mx-this.x;
	var beta=Math.atan2(deltaY,deltaX)+Math.PI;
	
	//lerp angle
	this.angle=lerpAngle(beta,this.angle,0.8);
	
	this.bigTailTimer+=deltaTime;
	if(this.bigTailTimer>80)
	{
		this.tailCount=(this.tailCount+1)%8;
		this.bigTailTimer%=80;
	}
	
	this.bigEyeTimer+=deltaTime;
	if(this.bigEyeTimer>this.internal)
	{
		this.eyeCount=(this.eyeCount+1)%2;
		this.bigEyeTimer%=this.internal;
		
		if(this.eyeCount==0)
		{
			this.internal=Math.random()*1500+2000;
		}
		else
		{
			this.internal=Math.random()*200+100;
		}
	}
	
	ctx1.save();
	ctx1.translate(this.x,this.y);
	ctx1.rotate(this.angle);
	ctx1.drawImage(this.bigTail,30-this.tailCount-this.bigTail.width*0.5,-this.bigTail.height*0.5);
	if(data.double==1)
	{
		ctx1.drawImage(momBodyOra[this.momBodyCount],-momBodyOra[this.momBodyCount].width*0.5,-momBodyOra[this.momBodyCount].height*0.5);
	}
	else
	{
		ctx1.drawImage(momBodyBlue[this.momBodyCount],-momBodyBlue[this.momBodyCount].width*0.5,-momBodyBlue[this.momBodyCount].height*0.5);
	}
	ctx1.drawImage(momEyes[this.eyeCount],-momEyes[this.eyeCount].width*0.5,-momEyes[this.eyeCount].height*0.5);
	
	ctx1.restore();
}